Learning Objectives

After completing this lesson, you’ll be able to:

Instructions

In this lesson, you will:

Resources

Exercise

Jennifer is ready to put her knowledge of lists into action!

She's been asked to identify the most common tree genus in Vancouver's parks.

She has point data of all the street trees in the city, as well as polygons of the parks. Now she needs to overlay these datasets (what you might know as a spatial join) to add information about each tree to the park polygons.

Jennifer knows that many FME transformers include a Generate List checkbox in the Attribute Accumulation section of their parameter dialog. For example:

Generate List checkbox

For query transformers that return multiple results, such as the PointOnAreaOverlayer, these parameters can be used to generate a list to store the results.

So, Jennifer plans to merge the tree points with the park polygons using the PointOnAreaOverlayer. However, copying attributes from each tree to its respective park polygon isn't enough; what if there is more than one tree per park?

List attributes are perfect for this scenario: if more than one tree falls within the same park polygon, she can use a list attribute to store information for all trees in each park. The PointOnAreaOverlayer allows her to generate a list that stores the values for all points overlaid on the area.

Her goal workspace will:

1) Open Starting Workspace

2) Run the Workspace and Inspect the Data

Viewing both caches

First, we'd like to visually understand the degree of overlap between the datasets so we can spot-check the list results. We decide to inspect a local park, China Creek North Park.

With the two datasets in Data Preview, do the following.

Searching for China Creek North park

Zooming to China Creek North

Trees in park

3) Set PointOnAreaOverlayer Parameters: Merge Attributes

How can we get a list of all trees in each park?

Merge Attributes, don't generate lists

4) Run the Workspace

Attributes from one tree species

5) Set PointOnAreaOverlayer Parameters: Generate List

Don't Merge Attributes, Generate List on Area

6) Run the Workspace

Viewing individual trees in the park list

We successfully used the PointOnAreaOverlayer to create a list called _trees{}, which stores the values of multiple tree points within each park polygon. Note how each numbered list element contains the same attributes: COMMON_NAME, DIAMETER, etc.

Now that we have lists of all the park trees, we can use list transformers to find the most common genus, which we'll do in the next lesson.

Leave Us Feedback on This Lesson